package com.shop.loan.controller;

import com.shop.loan.model.common.Constant;
import com.shop.loan.model.common.ResResult;
import com.shop.loan.model.vo.RentalDataBackVo;
import com.shop.loan.model.vo.RentalPayBackVo;
import com.shop.loan.service.NotifyService;
import com.shop.loan.service.PayService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

import javax.annotation.Resource;

@RestController
@RequestMapping(Constant.appPrefex)
public class NotifyController {

    @Resource
    NotifyService notifyService;

    @Resource
    PayService payService;

    @PostMapping("/rentalData/back")
    public ResResult rentalDataBack(@ApiIgnore RentalDataBackVo rentalDataBackVo) {
        return notifyService.rentalDataBack(rentalDataBackVo);
    }

    //支付回调
    @PostMapping("/rentalPay/back")
    public ResResult payNotify(@ApiIgnore RentalPayBackVo rentalPayBackVo) {
        return payService.payNotify(rentalPayBackVo);
    }
}
